import 'package:flutter/material.dart';

// ignore: must_be_immutable
class InforCard extends StatelessWidget {
  Color color;
  double height;
  int userId = 0;
  String account = "";
  String username = "";
  String email = "";
  InforCard(
      {required this.userId,
      required this.account,
      required this.username,
      required this.email,
      required this.height,
      required this.color,
      super.key});

  @override
  Widget build(BuildContext context) {
    final textTheme = Theme.of(context).textTheme;
    return Container(
      height: height,
      margin: const EdgeInsets.all(50),
      padding: const EdgeInsets.all(20),
      decoration:
          BoxDecoration(color: color, borderRadius: BorderRadius.circular(20)),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Container(
            margin: const EdgeInsets.all(4),
            // padding: EdgeInsets.all(8),
            height: 120,
            width: 120,

            decoration: BoxDecoration(
                // color: Colors.black.withOpacity(0.9),
                borderRadius: BorderRadius.circular(20)),
            child: ClipRRect(
              borderRadius: BorderRadius.circular(8),
              child: Image.network(
                "userImg",
                errorBuilder: (context, error, stackTrace) {
                  return Image.asset("assets/images/netError.jpg");
                },
              ),
            ),
          ),
          Text(
            username,
            style: textTheme.headlineSmall,
          ),
          Text("account: $account",
              style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 14)),
          Text("userId: ${userId.toString()}",
              style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 14)),
          Text("email: $email",
              style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 14)),
          const Text("he/him",
              style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14))
        ],
      ),
    );
  }
}
